<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
 数据缓存技术
 1. localStorage
 2. sessionStorage
-->

<button onclick="window.location.href='07-history03.html'">跳转页面</button>
<button onclick="window.localStorage.removeItem('username')">清除缓存</button>
<script>
    // localStorage 全局共享   多个网页均可以访问  token
    window.localStorage.setItem('username',"admin")
    // 获取localStorage中的值
    let username = window.localStorage.getItem('username')
    console.log(username)
    // 删除缓存数据
    // window.localStorage.removeItem('username')

    window.sessionStorage.setItem('password',"111111")

</script>

</body>
</html>
